package com.totcy.atom.presenter.contract;

import com.totcy.atom.bean.User;
import com.totcy.atom.bean.response.VoidResponse;
import com.totcy.baselibrary.base.mvpbase.BaseModel;
import com.totcy.baselibrary.base.mvpbase.BaseView;

import java.util.Map;

/**
 * Description 用户注册
 * Author: tu
 * Date: 2018-10-26
 * Time: 16:13
 */
public interface RegisterContract {
    interface View extends BaseView {
        /**
         * 注册成功
         *
         * @param response
         */
        void onRegisterResult(User response);

        /**
         * 注册失败
         */
        void onRegisterFail(String message);
    }

    interface Presenter {
        /**
         * Presenter 调用 model 获取数据
         */
        void doRegister(Map<String, Object> params);
    }

    interface Model extends BaseModel {
        interface DataCallback {
            /**
             * 注册成功
             *
             * @param response
             */
            void onRegisterResult(User response);

            /**
             * 注册失败
             */
            void onRegisterFail(String message);
        }

        /**
         * 从网络获取数据
         *
         * @param params   参数
         * @param callback 结果回调
         */
        void doRegister(Map<String, Object> params, DataCallback callback);

    }
}
